![]() |
FormatRecToString |
||||
Header: | NumberFormatting.h | Carbon status: | Supported | |
Converts an internal representation of number formatting information into a number format specification string, which can be displayed and modified.
FormatStatus FormatRecToString ( const NumFormatString *myCanonical, const NumberParts *partsTable, Str255 outString, TripleInt positions );
A pointer to the internal representation of number formatting information, as created by a previous call to the StringToFormatRec function.
A pointer to a structure, obtained from the tokens ('itl4') resource, that shows the correspondence between generic number part separators (tokens) and their localized version (for example, a thousand separator is a comma in the United States and a decimal point in France).
On output, contains the number format specification string.
An array that specifies the starting position and length of each of the three possible format strings (positive, negative, or zero) in the number format specification string. Semicolons are used as separators in the string.
A value that denotes the confidence level for the conversion that it performed. The low byte of the FormatStatus value is of type FormatResultType. Be sure to cast the result of FormatRecToString to a type FormatResultType before working with it.
FormatRecToString is the inverse operation of StringToFormatRec. The internal representation of the formatting information in myFormatRec must have been created by a prior call to the StringToFormatRec function. The information in the number parts table specifies how to build the string representation.
The output number format specification string in outString specifies how numbers appear. This string contains three parts, which are separated by semicolons. The first part is the positive number format, the second is the negative number format, and the third part is the zero number format.
The positions parameter is an array of three integers (a TripleInt value), which specifies the starting position in outString of each of three formatting specifications:
The index in outString of the first byte of the formatting specification for positive number values.
The index in outString of the first byte of the formatting specification for negative number values.
The index in outString of the first byte of the formatting specification for zero number values.
To obtain a handle to the number parts table from a tokens resource, use the GetIntlResourceTable function.
Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)